﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BackupRestore.BackupRestoreFramework;
using System.Reflection;

namespace BackupRestore.Utils
{
    /// <summary>
    /// Class containing regular Utility functions for Backups.  The Init function MUST be called before using this class.
    /// </summary>
    class BackupUtils
    {
        private static string _className;

        /// <summary>
        /// Init function:  Initializes the usage of this class.  This function MUST be called before using this class.
        /// </summary>
        public static void Init()
        {
            _className = MethodBase.GetCurrentMethod().DeclaringType.Name;
        }
        
        /// <summary>
        /// Builds a backup specification based on the paths provided (these paths will be backed up)
        /// </summary>
        /// <param name="paths"></param>
        /// <returns></returns>
        public static BackupSpecification BuildBackUpSpecification (string [] paths)
        {
            string _methodName = MethodBase.GetCurrentMethod().Name;

            Logger.Logger.LogMethodEntry(_className, _methodName);

            BackupSpecification specification = new BackupSpecification();

            specification.AddPaths(paths);

            Logger.Logger.LogMethodExit(_className, _methodName);     

            return specification;
        }


    }
}
